﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace NewBee.Core.DataService
{
    /// <summary>
    /// 数据库连接
    /// </summary>
    public class DataConnection
    {
        /// <summary>
        /// 读写连接字符串
        /// </summary>
        private static string _ConnectionString = string.Empty;

        /// <summary>
        /// 读写连接字符串
        /// </summary>
        public static string ConnectionString
        {
            get
            {
                //string str = _AppSettings.Value.Data.ConnectionString;
                string str = string.Empty;

                if (string.IsNullOrEmpty(str))
                {
                    str = "server=10.100.134.136;uid=sa;pwd=sasa;database=netexam";
                }

                return str;
            }
            set
            {
                _ConnectionString = value;
            }
        }

        /// <summary>
        /// 只读连接字符串
        /// </summary>
        private static string _QueryConnectionString = string.Empty;
        /// <summary>
        /// 只读连接字符串
        /// </summary>
        public static string QueryConnectionString
        {
            get
            {
                //string str = _AppSettings.Value.Data.QueryConnectionString;
                string str = string.Empty;

                if (string.IsNullOrEmpty(str))
                {
                    str = "server=10.100.134.136;uid=sa;pwd=sasa;database=netexam";
                }

                return str;
            }
            set
            {
                _QueryConnectionString = value;
            }
        }

        /// <summary>
        /// 数据库驱动类型
        /// </summary>
        private static string _DriverType = string.Empty;
        /// <summary>
        /// 数据库驱动类型
        /// </summary>
        public static string DriverType
        {
            get
            {
                //string str = _AppSettings.Value.Data.DriverType;
                string str = string.Empty;

                if (string.IsNullOrEmpty(str))
                {
                    str = "";
                }

                return str;
            }
            set
            {
                _DriverType = value;
            }
        }
    }
}
